📄 mem.c
字号:
// This file is part of MANTIS OS, Operating System// See http://mantis.cs.colorado.edu///// Copyright (C) 2003,2004,2005 University of Colorado, Boulder//// This program is free software; you can redistribute it and/or// modify it under the terms of the mos license (see file LICENSE)/* Project Mantis File: mem.c Author: Jeff Rose Date: 01-19-04 Just a simple implementation of the mos memory functions so we can use this in linux. TODO: Might want to add some logging functionality here to do some memory usage analysis.*/#include "mos.h"#include <stdlib.h>#include "mem.h"/* A placeholder function for compatability. */void mem_init(void *region, uint16_t size){ return;}/** Try to allocate a region of memory * @param size Size of the region to allocate. * @return NULL if not enough memory is available, else the allocated memory. */void *mos_mem_alloc(uint16_t size){ return malloc(size);}/** Free a block of memory * @param block Block of memory to free */void mos_mem_free(void* block){ free(block);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -