update powershell profile

This commit is contained in:
Shockwave 2023-11-19 16:21:14 +08:00
parent 9c8833308c
commit 8838f427ba
2 changed files with 32 additions and 1 deletions

View File

@ -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

View File

@ -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;
}