This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(generators, generator_trait)] | |
use std::ops::GeneratorState; | |
use std::pin::Pin; | |
fn generator_to_iterator<G>(g: G) -> impl Iterator<Item = G::Yield> | |
where | |
G: std::marker::Unpin + std::ops::Generator, | |
{ | |
struct GeneratorIter<G>(G); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
#[derive(Default)] | |
struct TrieNode { | |
is_leaf: bool, | |
children: HashMap<char, TrieNode>, | |
} | |
impl TrieNode { | |
fn add(&mut self, s: String) { | |
let mut root = self; | |
for c in s.chars() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
expect -c " | |
set timeout 10000 | |
spawn sudo pacman -Su | |
expect { | |
\"Proceed with installation\" {send -- y\r} | |
} | |
expect eof | |
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/auxv.h> | |
#include <elf.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <dlfcn.h> | |
void my_abort() { | |
printf("abort hijacked\n"); | |
exit(-1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOCAL_PATH:= $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_SRC_FILES:= test.c | |
LOCAL_CFLAGS := -Wno-error-unused-parameter | |
LOCAL_MODULE:= hello | |
LOCAL_MULTILIB := 32 | |
# LOCAL_LDFLAGS := ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<std::unique_ptr<const DexFile> > (OatFileManager::* ptrtofn)(const char *, const char *, jobject, jobjectArray, const art::OatFile **, std::vector<std::string> *) = &OatFileManager::OpenDexFilesFromOat; | |
VLOG(class_linker) << "sunway: " << (void * &)ptrtofn; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/linker/linker.cpp b/linker/linker.cpp | |
index c661624..f426fe8 100644 | |
--- a/linker/linker.cpp | |
+++ b/linker/linker.cpp | |
@@ -1029,6 +1029,16 @@ static int open_library_on_paths(ZipArchiveCache* zip_archive_cache, | |
} | |
if (fd != -1) { | |
+ ElfW(Ehdr) header; | |
+ ssize_t rc = TEMP_FAILURE_RETRY(pread64(fd, &header, sizeof(header), 0)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Machine description for AArch64 architecture. | |
Copyright (C) 2012-2014 Free Software Foundation, Inc. | |
Contributed by ARM Ltd. | |
This file is part of GCC. | |
GCC is free software; you can redistribute it and/or modify it under | |
the terms of the GNU General Public License as published by the Free | |
Software Foundation; either version 3, or (at your option) any later | |
version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WbXmlConverter.hpp> | |
#include <utils/String8.h> | |
using namespace android; | |
const char* WbXmlConverter::DRM_ELEMENT_CODE_PAGE[] = { | |
RO_ELEMENT_RIGHTS, RO_ELEMENT_CONTEXT, RO_ELEMENT_VERSION, RO_ELEMENT_UID, RO_ELEMENT_AGREEMENT, | |
RO_ELEMENT_ASSET, RO_ELEMENT_KEYINFO, RO_ELEMENT_KEYVALUE, RO_ELEMENT_PERMISSION, RO_ELEMENT_PLAY, | |
RO_ELEMENT_DISPLAY, RO_ELEMENT_EXECUTE, RO_ELEMENT_PRINT, RO_ELEMENT_CONSTRAINT, RO_ELEMENT_COUNT, | |
RO_ELEMENT_DATE_TIME, RO_ELEMENT_START_TIME, RO_ELEMENT_EXPIRY_TIME, RO_ELEMENT_AVAILABLE_TIME | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <libgen.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <getopt.h> |
NewerOlder