mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-31 13:42:33 +02:00
Merge libco repository's commit 'd31c6e75a54be12307d65fd80f55adfbe7aa9d67' into master
This commit is contained in:
9
libco/amd64.c
Executable file → Normal file
9
libco/amd64.c
Executable file → Normal file
@@ -2,9 +2,6 @@
|
||||
#include "libco.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -114,7 +111,7 @@ static void (*co_swap)(cothread_t, cothread_t) = 0;
|
||||
#endif
|
||||
|
||||
static void crash() {
|
||||
assert(0); /* called only if cothread_t entrypoint returns */
|
||||
LIBCO_ASSERT(0); /* called only if cothread_t entrypoint returns */
|
||||
}
|
||||
|
||||
cothread_t co_active() {
|
||||
@@ -142,13 +139,13 @@ cothread_t co_derive(void* memory, unsigned int size, void (*entrypoint)(void))
|
||||
}
|
||||
|
||||
cothread_t co_create(unsigned int size, void (*entrypoint)(void)) {
|
||||
void* memory = malloc(size);
|
||||
void* memory = LIBCO_MALLOC(size);
|
||||
if(!memory) return (cothread_t)0;
|
||||
return co_derive(memory, size, entrypoint);
|
||||
}
|
||||
|
||||
void co_delete(cothread_t handle) {
|
||||
free(handle);
|
||||
LIBCO_FREE(handle);
|
||||
}
|
||||
|
||||
void co_switch(cothread_t handle) {
|
||||
|
Reference in New Issue
Block a user