This file contains hidden or 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
// ==UserScript== | |
// @name SoundCloud Stream Player | |
// @namespace https://stefafafan.hatenablog.com/ | |
// @version 0.1 | |
// @description play songs from the stream, in oldest to newest order. | |
// @author stefafafan | |
// @match https://soundcloud.com/stream | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or 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 <iostream> | |
int main() | |
{ | |
std::cout << "Hello, world!" << std::endl; | |
return 0; | |
} |
This file contains hidden or 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
void *realloc(void *ptr, size_t size) | |
{ | |
char *p; | |
char *a = ptr; | |
// Realloc on a NULL pointer same as malloc. | |
if (ptr == NULL) | |
{ | |
p = malloc(size); | |
return p; |
This file contains hidden or 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
void *calloc(size_t nmemb, size_t size) | |
{ | |
char *p; | |
// If either is zero just return NULL. | |
if (nmemb == 0 || size == 0) | |
{ | |
return NULL; | |
} |
This file contains hidden or 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
void free(void *p) | |
{ | |
int size; | |
char *a; | |
a = (void *)p; | |
// Cannot free a NULL pointer. | |
if(p == NULL) | |
return; |
This file contains hidden or 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 <unistd.h> // for sbrk() | |
// Store free memory. | |
typedef struct free_list{ | |
int size; | |
struct free_list *next; | |
struct free_list *before; | |
} *Free_list; | |
Free_list f = NULL; |