move gcc required functions to string.c
This commit is contained in:
parent
9f833ca32c
commit
a6638d7af5
3 changed files with 16 additions and 8 deletions
|
|
@ -211,11 +211,3 @@ void heap_stats() {
|
|||
kprint("Total metadata overhead: "); kprint_int((used_blocks + free_blocks) * sizeof(HeapHeader)); kprint(" bytes\n");
|
||||
kprint("-------------------------\n");
|
||||
}
|
||||
|
||||
void *memset(void *s, int c, size_t n) {
|
||||
unsigned char *p = s;
|
||||
while (n--) {
|
||||
*p++ = (unsigned char)c;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
10
src/lib/string.c
Normal file
10
src/lib/string.c
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include <stddef.h>
|
||||
#include "string.h"
|
||||
|
||||
void *memset(void *s, int c, size_t n) {
|
||||
unsigned char *p = s;
|
||||
while (n--) {
|
||||
*p++ = (unsigned char)c;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
6
src/lib/string.h
Normal file
6
src/lib/string.h
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef STRING_H
|
||||
#define STRING_H
|
||||
|
||||
void *memset(void *s, int c, size_t n);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue