update powershell profile
This commit is contained in:
parent
9c8833308c
commit
8838f427ba
|
@ -24,8 +24,9 @@ Remove-Variable -Name "msg"
|
|||
|
||||
# ======================= Import Modules =======================
|
||||
Import-Module PSReadLine
|
||||
Invoke-Expression (& { (zoxide init powershell | Out-String) })
|
||||
# NOTE: ZLocation is imported at last
|
||||
Import-Module ZLocation
|
||||
# Import-Module ZLocation
|
||||
|
||||
# Auto complete
|
||||
Set-PSReadlineOption -EditMode Emacs
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define FLEXABLE_LEN 0
|
||||
#define PAGE_SIZE 8192
|
||||
|
||||
typedef struct {
|
||||
int low;
|
||||
int high;
|
||||
int capacity;
|
||||
char data[FLEXABLE_LEN];
|
||||
} SimplePage;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
SimplePage *page = (SimplePage *) malloc(PAGE_SIZE);
|
||||
memset(page, 0, PAGE_SIZE);
|
||||
int base_size = sizeof(SimplePage);
|
||||
page->capacity = PAGE_SIZE - base_size;
|
||||
page->low = 0;
|
||||
page->high = page->capacity;
|
||||
|
||||
char *s = "测试数据";
|
||||
int s_len = strlen(s);
|
||||
int tmp_pos = page->high - s_len;
|
||||
char *start_cpy = &(page->data[tmp_pos]);
|
||||
memcpy(start_cpy, s, s_len);
|
||||
free(page);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue